<?php
namespace app\index\controller;
use think\Controller;

class Index extends Controller
{

    //博客首页
    public function index()
    {
        //获取轮播图信息
        $banners = model('Banner') -> getNormalBannerInfo();
        //获取banner图的数量
        $bannerNum = count($banners);
        //获取文章信息
        $articles = model('Article') -> getNormalArticles();

        //获取标签信息
        $tags = model('Tag') -> getNormalTagsInfo();
       return $this -> fetch('',[
           'articles' => $articles,
           'banners' => $banners,
           'bannerNum' => $bannerNum,
           'tags' => $tags
           ]);

    }
}
